static void
calculate_offscreen_box (StThemeNodeTransition *transition,
const ClutterActorBox *allocation)
+{
+ ClutterActorBox paint_box;
+
+ st_theme_node_transition_get_paint_box (transition,
+ allocation,
+ &paint_box);
+ transition->priv->offscreen_box.x1 = paint_box.x1 - allocation->x1;
+ transition->priv->offscreen_box.y1 = paint_box.y1 - allocation->y1;
+ transition->priv->offscreen_box.x2 = paint_box.x2 - allocation->x1;
+ transition->priv->offscreen_box.y2 = paint_box.y2 - allocation->y1;
+}
+
+void
+st_theme_node_transition_get_paint_box (StThemeNodeTransition *transition,
+ const ClutterActorBox *allocation,
+ ClutterActorBox *paint_box)
{
StThemeNodeTransitionPrivate *priv = transition->priv;
ClutterActorBox old_node_box, new_node_box;
allocation,
&new_node_box);
- priv->offscreen_box.x1 = MIN (old_node_box.x1, new_node_box.x1)
- - allocation->x1;
- priv->offscreen_box.y1 = MIN (old_node_box.y1, new_node_box.y1)
- - allocation->y1;
- priv->offscreen_box.x2 = MAX (old_node_box.x2, new_node_box.x2)
- - allocation->x1;
- priv->offscreen_box.y2 = MAX (old_node_box.y2, new_node_box.y2)
- - allocation->y1;
+ paint_box->x1 = MIN (old_node_box.x1, new_node_box.x1);
+ paint_box->y1 = MIN (old_node_box.y1, new_node_box.y1);
+ paint_box->x2 = MAX (old_node_box.x2, new_node_box.x2);
+ paint_box->y2 = MAX (old_node_box.y2, new_node_box.y2);
}
static gboolean
ClutterActorBox *allocation,
guint8 paint_opacity);
+void st_theme_node_transition_get_paint_box (StThemeNodeTransition *transition,
+ const ClutterActorBox *allocation,
+ ClutterActorBox *paint_box);
+
G_END_DECLS
#endif
{
ClutterActorBox paint_box, alloc_box;
StThemeNode *theme_node;
+ StWidgetPrivate *priv;
ClutterVertex origin;
/* Setting the paint volume does not make sense when we don't have any allocation */
if (!clutter_actor_has_allocation (self))
return FALSE;
+ priv = ST_WIDGET(self)->priv;
+
theme_node = st_widget_get_theme_node (ST_WIDGET(self));
clutter_actor_get_allocation_box (self, &alloc_box);
- st_theme_node_get_paint_box (theme_node, &alloc_box, &paint_box);
+
+ if (priv->transition_animation)
+ st_theme_node_transition_get_paint_box (priv->transition_animation,
+ &alloc_box, &paint_box);
+ else
+ st_theme_node_get_paint_box (theme_node, &alloc_box, &paint_box);
origin.x = paint_box.x1 - alloc_box.x1;
origin.y = paint_box.y1 - alloc_box.y1;